package com.ruoyi.caiwu.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.caiwu.mapper.AccountingVoucherEntryMapper;
import com.ruoyi.caiwu.domain.AccountingVoucherEntry;
import com.ruoyi.caiwu.service.IAccountingVoucherEntryService;

/**
 * 凭证分录Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class AccountingVoucherEntryServiceImpl implements IAccountingVoucherEntryService
{
    @Autowired
    private AccountingVoucherEntryMapper accountingVoucherEntryMapper;

    /**
     * 查询凭证分录
     *
     * @param entryId 凭证分录主键
     * @return 凭证分录
     */
    @Override
    public AccountingVoucherEntry selectAccountingVoucherEntryByEntryId(Long entryId)
    {
        return accountingVoucherEntryMapper.selectAccountingVoucherEntryByEntryId(entryId);
    }

    /**
     * 查询凭证分录列表
     *
     * @param accountingVoucherEntry 凭证分录
     * @return 凭证分录
     */
    @Override
    public List<AccountingVoucherEntry> selectAccountingVoucherEntryList(AccountingVoucherEntry accountingVoucherEntry)
    {
        return accountingVoucherEntryMapper.selectAccountingVoucherEntryList(accountingVoucherEntry);
    }

    /**
     * 新增凭证分录
     *
     * @param accountingVoucherEntry 凭证分录
     * @return 结果
     */
    @Override
    public int insertAccountingVoucherEntry(AccountingVoucherEntry accountingVoucherEntry)
    {
        return accountingVoucherEntryMapper.insertAccountingVoucherEntry(accountingVoucherEntry);
    }

    /**
     * 修改凭证分录
     *
     * @param accountingVoucherEntry 凭证分录
     * @return 结果
     */
    @Override
    public int updateAccountingVoucherEntry(AccountingVoucherEntry accountingVoucherEntry)
    {
        return accountingVoucherEntryMapper.updateAccountingVoucherEntry(accountingVoucherEntry);
    }

    /**
     * 批量删除凭证分录
     *
     * @param entryIds 需要删除的凭证分录主键
     * @return 结果
     */
    @Override
    public int deleteAccountingVoucherEntryByEntryIds(Long[] entryIds)
    {
        return accountingVoucherEntryMapper.deleteAccountingVoucherEntryByEntryIds(entryIds);
    }

    /**
     * 删除凭证分录信息
     *
     * @param entryId 凭证分录主键
     * @return 结果
     */
    @Override
    public int deleteAccountingVoucherEntryByEntryId(Long entryId)
    {
        return accountingVoucherEntryMapper.deleteAccountingVoucherEntryByEntryId(entryId);
    }
}
